#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
int main()
{
    int x=1;
    int y=5;
    int i,j;
    int velocity_x=1;
    int velocity_y=1;
    int top=0,bottom=10,left=0,right=20;
    for(j=0;j<right;j++)
        printf("-");
    while(1)
    {
        x+=velocity_x;
        y+=velocity_y;
        system("cls");
        for(i=0;i<x;i++)
        printf("\n");
        for(j=0;j<y;j++)
        printf(" ");
        printf("o");
        printf("\n");
        Sleep(50);
        if(x==top||x==bottom)
            velocity_x=-1*velocity_x;
        if(y==left||y==right)
            velocity_y=-1*velocity_y;
    }
    return 0;
}